from django.db import models
from django.contrib.auth.models import AbstractUser

from common.django_utlis import BaseModel


class User(AbstractUser):
    class Meta:
        verbose_name = "用户"
        verbose_name_plural = verbose_name


class Announcement(BaseModel):
    promulgator = models.ForeignKey(to="User", verbose_name="发布者", on_delete=models.DO_NOTHING)
    title = models.CharField(verbose_name="标题", max_length=50)
    content = models.TextField(verbose_name="公告内容")
    expire_date = models.DateTimeField(verbose_name="过期时间")

    class Meta:
        verbose_name = '公告'
        verbose_name_plural = verbose_name
